package com.chartHandle.dubbo.exposureInterface;

import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.chartHandle.excelService.service.WriteOrderInfoInfoService;
import com.chartHandle.excelService.service.WriteSmokeInfoListService;
import com.chartHandle.excelService.service.WriteWeeklySupplyStrategyDataService;
import com.dubboInterface.merchant.chartHandleInterface.ExcelWrite;
import com.projectCommon.bean.Smoke;
import com.projectCommon.bean.dto.SmokeDto;
import com.projectCommon.bean.easyExcel.ExcelSmokeInfo;
import com.projectCommon.bean.easyExcel.putTactics.WeeklySupplyStrategyData;
import com.projectCommon.util.springUtil.annotation.LogInitContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * @author 吴宇~
 * @motto 我亦无他，唯手熟尔。
 * @edition jdk1.8
 * @reflection 0-1 喧闹任其喧闹，自由我自为之，我自风情万种，与世无争。
 * @date 2024/12/01/14:44
 * @target 心若有所向往，何惧道阻且长
 */

@Component
@Service
public class ExcelWriteInterface implements ExcelWrite {
    @Autowired
    private WriteWeeklySupplyStrategyDataService writeWeeklySupplyStrategyDataService;
    @Autowired
    private WriteOrderInfoInfoService writeOrderInfoInfoService;
    @Autowired
    private WriteSmokeInfoListService writeSmokeInfoListService;

    @Override
    public byte[] weeklySupplyStrategyWrite(ExcelTypeEnum excelTypeEnum, WeeklySupplyStrategyData weeklySupplyStrategyData, Map<String, Smoke> dbInfo) {
        byte[] bytes = writeWeeklySupplyStrategyDataService.writeTemplate1(excelTypeEnum, weeklySupplyStrategyData, dbInfo);
        return bytes;
    }
    @Override
    public byte[] writeOrderInfoTemplate1(List<ExcelSmokeInfo> excelSmokeInfo)  {
        byte[] bytes = writeOrderInfoInfoService.writeOrderInfoTemplate1(excelSmokeInfo);
        return bytes;
    }
    @Override
    public byte[] writeSmokeListInfo(String templateName, List<SmokeDto> smokeDtoList) {
        return writeSmokeInfoListService.writeSmokeListInfo(templateName, smokeDtoList);
    }
}
